import Cookies from 'js-cookie'

// js-cookie 是一个操作 cookie 的插件 => 原生操作cookie语法特别麻烦, 解析字符串
// Cookies.get('key')          获取     =>  localStorage.getItem(xxx)
// Cookies.set('key', 'value') 设置     =>  localStorage.setItem(xxx, xxx)
// Cokkies.remove('key')       移除     =>  localStorage.removeItem(xxx)

const TokenKey = 'hrsaas_100_token'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
